/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
function updateProjects(){
    var projectID;
    var projectName;
    var projectManager;
    var description;
    var numOfMinestone;

    var startDay;
    var sdyear;
    var sdmonth;
    var sdday;

    var endDay;
    var edyear;
    var edmonth;
    var edday;
    var status;
    var i;
    sdmonth =document.getElementById('tableA').rows[1].cells[5].childNodes[1].value;
    window.alert(sdmonth)
}


function schange(){
    var dayList = new Array(
        new Option("1","01"),new Option("2","02"),new Option("3","03"),
        new Option("4","04"),new Option("5","05"),new Option("6","06"),new Option("7","07"),
        new Option("8","08"),new Option("9","09"),new Option("10","10"),new Option("11","11"),
        new Option("12","12"),new Option("13","13"),new Option("14","14"),new Option("15","15"),
        new Option("16","16"),new Option("17","17"),new Option("18","18"),new Option("19","19"),
        new Option("20","20"),new Option("21","21"),new Option("22","22"),new Option("23","23"),
        new Option("24","24"),new Option("25","25"),new Option("26","26"),new Option("27","27"),new Option("28","28"));

    var yId=document.getElementById("syearId")
    var chosenoption=yId.options[yId.selectedIndex]
    var y = chosenoption.value;

    var mId=document.getElementById("smonthId")
    var chosenoption1=mId.options[mId.selectedIndex]
    var m = chosenoption1.value;

    if (m=="01" || m=="03"|| m=="05"|| m=="07"|| m=="08"|| m=="10"|| m=="12"){
        dayList.push(new Option("29","29"));
        dayList.push(new Option("30","30"));
        dayList.push(new Option("31","31"));
    } else if (m=="04"|| m=="06"|| m=="09"|| m=="11"){
        dayList.push(new Option("29","29"));
        dayList.push(new Option("30","30"));
    } else if (y%4!=0 && m=="02"){
        dayList.push(new Option("29","29"));
    }
    var myselect=document.getElementById("sdayId")
    while (myselect.length>0){
        myselect.remove(myselect.length-1);
    }
    //add day
    for (var i = 0; i< dayList.length; i++){
        try{
            myselect.add(dayList[i], null);
        }
        catch(e){
            myselect.add(dayList[i]);
        }
    }
}

function echange(){
    var dayList = new Array(
        new Option("1","01"),new Option("2","02"),new Option("3","03"),
        new Option("4","04"),new Option("5","05"),new Option("6","06"),new Option("7","07"),
        new Option("8","08"),new Option("9","09"),new Option("10","10"),new Option("11","11"),
        new Option("12","12"),new Option("13","13"),new Option("14","14"),new Option("15","15"),
        new Option("16","16"),new Option("17","17"),new Option("18","18"),new Option("19","19"),
        new Option("20","20"),new Option("21","21"),new Option("22","22"),new Option("23","23"),
        new Option("24","24"),new Option("25","25"),new Option("26","26"),new Option("27","27"),new Option("28","28"));

    var yId=document.getElementById("eyearId")
    var chosenoption=yId.options[yId.selectedIndex]
    var y = chosenoption.value;

    var mId=document.getElementById("emonthId")
    var chosenoption12=mId.options[mId.selectedIndex]
    var m = chosenoption12.value;

    if (m=="01" || m=="03"|| m=="05"|| m=="07"|| m=="08"|| m=="10"|| m=="12"){
        dayList.push(new Option("29","29"));
        dayList.push(new Option("30","30"));
        dayList.push(new Option("31","31"));
    } else if (m=="04"|| m=="06"|| m=="09"|| m=="11"){
        dayList.push(new Option("29","29"));
        dayList.push(new Option("30","30"));
    } else if (y%4!=0 && m=="02"){
        dayList.push(new Option("29","29"));
    }
    var myselect=document.getElementById("edayId")
    while (myselect.length>0){
        myselect.remove(myselect.length-1);
    }
    //add day
    for (var i = 0; i< dayList.length; i++){
        try{
            myselect.add(dayList[i], null);
        }
        catch(e){
            myselect.add(dayList[i]);
        }
    }
}

